<template>
	<el-dialog :title="titleMap[mode]" v-model="visible" width="70%" destroy-on-close @closed="$emit('closed')" :close-on-click-modal="false">
        <el-container>
			<el-header>
				<div class="left-panel">
                    <div class="right-panel-search">
                        <div class="search-input">设备名称</div>
                        <el-input v-model="orderNumber" placeholder="请输入设备名称" style="width:10%" />
                        <div class="search-input">设备编号</div>
                        <el-input v-model="orderNumber" placeholder="请输入设备编号" style="width:10%" />
                        <div class="search-input">设备状态</div>
                        <el-select v-model="apply_cate" placeholder="请选择" style="width:10%">
                            <el-option label="开" :value="1"></el-option>
                            <el-option label="关" :value="2"></el-option>
                        </el-select>
                        <div class="search-input">车间</div>
                        <el-select v-model="apply_cate" placeholder="请选择" style="width:10%">
                            <el-option label="开" :value="1"></el-option>
                            <el-option label="关" :value="2"></el-option>
                        </el-select>
                        <div class="search-input">产间</div>
                        <el-select v-model="apply_cate" placeholder="请选择" style="width:10%">
                            <el-option label="开" :value="1"></el-option>
                            <el-option label="关" :value="2"></el-option>
                        </el-select>
                        <el-button type="primary" icon="el-icon-search" @click="upsearch">查询</el-button>
                    </div>
				</div>
			</el-header>
			<el-main class="nopadding">
				<scTable ref="table" :apiObj="apiObj" stripe remoteSort remoteFilter height="400" border>
					<el-table-column type="selection" width="50" align="center"></el-table-column>
                    <el-table-column prop="process_id" label="设备编号" align="center"></el-table-column>
                    <el-table-column prop="price" label="设备名称" align="center"></el-table-column>
                    <el-table-column prop="price" label="设备规格" align="center"></el-table-column>
                    <el-table-column prop="price" label="设备状态" align="center">
                        <template #default="scope">
                            <el-tag v-if="scope.row.status==1" type="success">正常</el-tag>
                        </template>
                    </el-table-column>
                    <el-table-column prop="staff_id" label="设备类别"></el-table-column>
                    <el-table-column prop="staff_id" label="车间"></el-table-column>
                    <el-table-column prop="staff_id" label="产线"></el-table-column>
                    <el-table-column prop="staff_id" label="负责人"></el-table-column>
					<el-table-column prop="create_time" label="创建时间" align="center"></el-table-column>
				</scTable>
			</el-main>
		</el-container>
		<template #footer>
			<el-button @click="visible = false">取 消</el-button>
			<el-button v-if="mode != 'show'" type="primary" :loading="isSaveing" @click="submit()">确 定</el-button>
		</template>
	</el-dialog>
</template>

<script>
export default {
	emits: ['success', 'closed'],
	data() {
		return {
			mode: "add",
			titleMap: {
				add: '选择设备',
			},
			visible: false,
			isSaveing: false,
		}
	},
	mounted() {
	},
	methods: {
		//显示
		open(mode = 'add') {
			this.mode = mode;
			this.visible = true;
			return this
		},
        submit(){
            this.visible = false
        },
	}
}
</script>

<style></style>
